#pragma once

#include <string.h>
#include <stdio.h>
#include <string>
#include <exception>
#include <stdexcept>
#include <glog/logging.h>

#define LOG_DEBUG(format, ...)                                          \
     {                                                                  \
          char buffer[1024];                                            \
          snprintf(buffer, sizeof(buffer), format "\n", ##__VA_ARGS__); \
          LOG(INFO) << buffer;                                          \
     }

#define LOG_INFO(format, ...)                                           \
     do                                                                 \
     {                                                                  \
          char buffer[1024];                                            \
          snprintf(buffer, sizeof(buffer), format "\n", ##__VA_ARGS__); \
          LOG(INFO) << buffer;                                          \
     } while (0)

#define LOG_WARN(format, ...)                                           \
     do                                                                 \
     {                                                                  \
          char buffer[1024];                                            \
          snprintf(buffer, sizeof(buffer), format "\n", ##__VA_ARGS__); \
          LOG(WARNING) << buffer;                                       \
     } while (0)

#define LOG_ERROR(format, ...)                                          \
     do                                                                 \
     {                                                                  \
          char buffer[1024];                                            \
          snprintf(buffer, sizeof(buffer), format "\n", ##__VA_ARGS__); \
          LOG(ERROR) << buffer;                                         \
     } while (0)

#define LOG_FATAL(format, ...)                                          \
     do                                                                 \
     {                                                                  \
          char buffer[1024];                                            \
          snprintf(buffer, sizeof(buffer), format "\n", ##__VA_ARGS__); \
          LOG(FATAL) << buffer;                                         \
     } while (0)
